/**
 * 
 */
package edu.sjtu.se.prophet.driver;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @author willard
 *
 */
public class TempTest {
    private static class Token implements Comparable<Token> {
        public int index;
        
        public Token(int i) {
            index = i;
        }
        
        @Override
        public int compareTo(Token o) {
            if (index < o.index)
                return -1;
            else if (index > o.index)
                return 1;
            return 0;
        }
        
    }

    /**
     * @param args
     */
    public static void main(String[] args) {
        List<Token> tokens = new ArrayList<Token>();
        tokens.add(new Token(1));
        tokens.add(new Token(4));
        tokens.add(new Token(2));
        tokens.add(new Token(5));
        tokens.add(new Token(3));

        Collections.sort(tokens);
        
        for (int i=0; i<tokens.size(); i++)
            System.out.println(tokens.get(i).index);
    }

}
